package com.medical.patient.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.medical.common.utils.PageUtils;
import com.medical.common.utils.Query;

import com.medical.patient.dao.PatientWalletDao;
import com.medical.patient.entity.PatientWalletEntity;
import com.medical.patient.service.PatientWalletService;


@Service("patientWalletService")
public class PatientWalletServiceImpl extends ServiceImpl<PatientWalletDao, PatientWalletEntity> implements PatientWalletService {

    @Autowired
    private PatientWalletDao patientWalletDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<PatientWalletEntity> page = this.page(
                new Query<PatientWalletEntity>().getPage(params),
                new QueryWrapper<PatientWalletEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public PatientWalletEntity walletListByUserId(String userId) {
        PatientWalletEntity patientWalletEntity = patientWalletDao.walletListByUserId(userId);
        return patientWalletEntity;
    }

    //余额展示
    @Override
    public PatientWalletEntity balanceByUserId(String userId) {
        PatientWalletEntity patientWalletEntity = patientWalletDao.balanceByUserId(userId);
        return patientWalletEntity;
    }

}